<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>实现跳转</title>
    <style>
        
    </style>
</head>
<body>
    <h3 id="tital">提交成功</h3>
    <p>
        <span id="time" style="font-size: 24px;color: #f60808;">5</span>
        跳转到百度网页
    </p>
    <script type="text/javascript">
        count= 3;
        function ff(){
            var oSpan = document.getElementById("time");
            oSpan.innerHTML =count;
            count--;
             var time1=setTimeout(ff,1000);
            if(count<=0){
//                clearInterval(time1);
                clearTimeout(time1);//清除定时器
                tiao();
            }
        }
//        time1 = setInterval(ff,1000);
        ff();

        跳转函数
         function tiao(){
             var url ="https://www.baidu.com/";
             window.location.href=url; 
         } 

    </script>
    
</body>
</html>



// function timedown(){
    //     var sec=3
    //     var t=document.getElementById("time");
        
    //     t=countdown(t);
    //     t.innerHTML=t;
    //     clearTimeout(clock,1000);
    // }
    // clock();


    

    //时间减函数
    // function countdown(t){
    //         if(t>0){
    //             t--;    
    //         }
    //         clearTimeout(clock,1000);
    //         return t;
    // }
//https://www.baidu.com/